3.2523 \(\int x^{-1-n} (a+b x^n) \, dx\)

Optimal. Leaf size=16 \[ b \log (x)-\frac{a x^{-n}}{n} \]

[Out]

-(a/(n*x^n)) + b*Log[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0055173, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {14} \[ b \log (x)-\frac{a x^{-n}}{n} \]

Antiderivative was successfully verified.

[In]

Int[x^(-1 - n)*(a + b*x^n),x]

[Out]

-(a/(n*x^n)) + b*Log[x]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int x^{-1-n} \left (a+b x^n\right ) \, dx &=\int \left (\frac{b}{x}+a x^{-1-n}\right ) \, dx\\ &=-\frac{a x^{-n}}{n}+b \log (x)\\ \end{align*}

Mathematica [A]  time = 0.0097582, size = 16, normalized size = 1. \[ b \log (x)-\frac{a x^{-n}}{n} \]

Antiderivative was successfully verified.

[In]

Integrate[x^(-1 - n)*(a + b*x^n),x]

[Out]

-(a/(n*x^n)) + b*Log[x]

________________________________________________________________________________________

Maple [A]  time = 0.01, size = 25, normalized size = 1.6 \begin{align*}{\frac{1}{{{\rm e}^{n\ln \left ( x \right ) }}} \left ( b\ln \left ( x \right ){{\rm e}^{n\ln \left ( x \right ) }}-{\frac{a}{n}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(-1-n)*(a+b*x^n),x)

[Out]

(b*ln(x)*exp(n*ln(x))-a/n)/exp(n*ln(x))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.01863, size = 41, normalized size = 2.56 \begin{align*} \frac{b n x^{n} \log \left (x\right ) - a}{n x^{n}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="fricas")

[Out]

(b*n*x^n*log(x) - a)/(n*x^n)

________________________________________________________________________________________

Sympy [A]  time = 14.4492, size = 107, normalized size = 6.69 \begin{align*} \begin{cases} a x + b \log{\left (x \right )} & \text{for}\: n = -1 \\\left (a + b\right ) \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{a n}{n^{2} x^{n} + n x^{n}} - \frac{a}{n^{2} x^{n} + n x^{n}} + \frac{b n^{2} x^{n} \log{\left (x \right )}}{n^{2} x^{n} + n x^{n}} + \frac{b n x^{n} \log{\left (x \right )}}{n^{2} x^{n} + n x^{n}} + \frac{b n x^{n}}{n^{2} x^{n} + n x^{n}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(-1-n)*(a+b*x**n),x)

[Out]

Piecewise((a*x + b*log(x), Eq(n, -1)), ((a + b)*log(x), Eq(n, 0)), (-a*n/(n**2*x**n + n*x**n) - a/(n**2*x**n +
 n*x**n) + b*n**2*x**n*log(x)/(n**2*x**n + n*x**n) + b*n*x**n*log(x)/(n**2*x**n + n*x**n) + b*n*x**n/(n**2*x**
n + n*x**n), True))

________________________________________________________________________________________

Giac [A]  time = 1.15774, size = 28, normalized size = 1.75 \begin{align*} \frac{b n x^{n} \log \left (x\right ) - a}{n x^{n}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="giac")

[Out]

(b*n*x^n*log(x) - a)/(n*x^n)